<template>
    <!--建档资料维护模块  投保经历页面-->
    <div class="baseInfoPage">
        <div class="table_container mt20">
            <el-table
                :data="cusf05List"
                highlight-current-row
                header-cell-class-name="table-header-class"
                style="width:100%">
                <el-table-column
                    property="note2"
                    label="Note2"
                    align='center'>
                </el-table-column>
                <el-table-column
                    property="remark02"
                    label="保险公司"
                    align='center'>
                </el-table-column>
                <el-table-column
                    property="instprem01"
                    label="寿险保额(万元)"
                    align='center'>
                </el-table-column>
                <el-table-column
                    property="instprem02"
                    label="意外险保额(万元)"
                    align='center'>
                </el-table-column>
                <el-table-column
                    property="instprem03"
                    label="住院保障(万元)"
                    align='center'>
                </el-table-column>
                <el-table-column
                width="120"
                    property="dateup"
                    label="生效或申请日期"
                    align='center'>
                </el-table-column>
                <el-table-column
                    property="note1"
                    label="Note1"
                    align='center'>
                </el-table-column>
                <el-table-column
                    width="200"
                    property="remark01"
                    label="是否被加费或除外责任承保"
                    align='center'>
                </el-table-column>
            </el-table>
        </div> 

         <el-form :rules="rules" ref="insurexprn" label-width="120px" class="search_container">
            <el-row class="mt10">
                    <el-col :span="6">
                        <el-form-item label="同业记录" prop="sumasind">
                            <el-select :disabled="flag =='N'" v-model="euad2.sumasind" @change="sumasindChange" placeholder="请选择" >
                                <el-option
                                    v-for="item in sumasinds"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                     <el-col :span="6">
                        <el-form-item label="寿险(万元)" prop="sumins01">
                            <el-input-number   v-model="euad2.sumins01" :min="0" :max="99999.99"
                                :precision="2" :step="0.1" controls-position="right" :disabled="dis_sumins01 ||flag =='N'"/>
                        </el-form-item>
                    </el-col>
                     <el-col :span="6">
                        <el-form-item label="意外险(万元)" prop="sumins02">
                            <el-input-number   v-model="euad2.sumins02" :min="0" :max="99999.99"
                                :precision="2" :step="0.1" controls-position="right" :disabled="dis_sumins02 || flag =='N'" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="标准体" prop="stdflag">
                            <el-select :disabled="flag =='N'"  v-model="euad2.stdflag"  placeholder="请选择" >
                                <el-option
                                    v-for="item in stdflag"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                     <el-col :span="16" class="common-box">
                        <el-col :span="7" class="common-lab">
                             <label class="labelName">申请过理赔</label>
                        </el-col>
                         <el-col :span="5" class="pr10">
                            <el-select :disabled="flag =='N'"  v-model="insurexprn.isApplyClm"  placeholder="请选择" >
                                <el-option
                                    v-for="item in isApplyClm"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value">
                                </el-option>
                            </el-select>
                         </el-col>
                         <el-col :span="12">
                             <el-input :disabled="flag =='N'"  v-model="insurexprn.applyClmInfo" placeholder="文本"></el-input>
                         </el-col>
                    </el-col>
                </el-row>
                <el-row>
                     <el-col :span="16" class="common-box">
                        <el-col :span="7" class="common-lab">
                             <label class="labelName">因投保本合同而退保同行业之保险合同</label>
                        </el-col>
                         <el-col :span="5" class="pr10">
                            <el-select :disabled="flag =='N'"  v-model="insurexprn.isRtrncntrct" placeholder="请选择" >
                                <el-option
                                    v-for="item in isRtrncntrct"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value">
                                </el-option>
                            </el-select>
                         </el-col>
                         <el-col :span="12">
                             <el-input :disabled="flag =='N'"  v-model="insurexprn.rtrncntrctInfo" placeholder="文本"></el-input>
                         </el-col>
                    </el-col>
                </el-row>
                <el-row>
                     <el-col :span="16" class="common-box">
                        <el-col :span="7" class="common-lab">
                             <label class="labelName">投保人被拒保/延期/加费/附加条件承保</label>
                        </el-col>
                         <el-col :span="5" class="pr10">
                            <el-select :disabled="flag =='N'"  v-model="insurexprn.isCnclcntrct" placeholder="请选择" >
                                <el-option
                                    v-for="item in isCnclcntrct"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value">
                                </el-option>
                            </el-select>
                         </el-col>
                         <el-col :span="12">
                             <el-input :disabled="flag =='N'"  v-model="insurexprn.cnclcntrctInfo" placeholder="文本"></el-input>
                         </el-col>
                    </el-col>
                </el-row>
                 <el-row>
                     <el-col :span="16" class="common-box">
                        <el-col :span="7" class="common-lab">
                             <label class="labelName">其他说明</label>
                        </el-col>
                         <el-col :span="16">
                             <el-input :disabled="flag =='N'"  v-model="insurexprn.otherExpln" placeholder="文本"></el-input>
                         </el-col>
                    </el-col>
                 </el-row>
        </el-form>

    </div>
</template>
<script>
    import constant from '@/utils/constant';
    export default {
        data(){
            return {
                value:'',
                //  投保经历表格  ***excl表备注数据有误
                cusf05List: null,
                insurexprn:{
                    sumasind:'',
                    sumins01:'',
                    sumins02:'',
                    stdflag:[],
                    isApplyClm:[],
                    applyClmInfo:'',
                    isRtrncntrct:[],
                    rtrncntrctInfo:'',
                    isCnclcntrct:[],
                    cnclcntrctInfo:'',
                    otherExpln:'',
                },
                euad2: {},
                sumasinds:[
                    {
                        value:'',
                        label:'',
                    }, 
                    {
                        value:'Y',
                        label:'是',
                    }, {
                        value:'N',
                        label:'否',
                    }
                ],
                // 标准体
                stdflag:[
                    {
                        value:'Y',
                        label:'是',
                    }, {
                        value:'N',
                        label:'否',
                    }
                ],
                // 申请过理赔
                isApplyClm:[
                    {
                        value:'',
                        label:'',
                    },
                    {
                        value:'Y',
                        label:'是',
                    }, {
                        value:'N',
                        label:'否',
                    }
                ],
                // 因投保本合同而退保同行业之保险合同
                isRtrncntrct:[
                    {
                        value:'',
                        label:'',
                    },
                    {
                        value:'Y',
                        label:'是',
                    }, {
                        value:'N',
                        label:'否',
                    }
                ],
                // 投保人被拒保/延期/加费/附加条件承保
                isCnclcntrct:[
                    {
                        value:'',
                        label:'',
                    },
                    {
                        value:'Y',
                        label:'是',
                    }, {
                        value:'N',
                        label:'否',
                    }
                ],
                rules: {},
                insureDataForm: this.insureData,
                dis_sumins01: true,
                dis_sumins02: true
            }
        },
        props:{
			flag:{
				type:String
			},
            insureData:{
                type: Object,
            }
        },
        mounted(){
            this.reloadInsureData(null);
        },
        methods: {
            reloadInsureData(insureData){
                if(insureData != null){
                    this.insureDataForm = insureData;
                }
                this.cusf05List = this.insureDataForm.cusf05List;
                this.insurexprn = this.insureDataForm.insurexprn;
                this.euad2 = this.insureDataForm.euad2;
                if(this.euad2.sumasind == 'Y'){
                    this.dis_sumins01 = false;
                    this.dis_sumins02 = false;
                }
            },
            getInsureData(insureData){
                return this.insureData;
            },
            sumasindChange(){
                if(this.euad2.sumasind == 'Y'){
                    this.dis_sumins01 = false;
                    this.dis_sumins02 = false;
                }else{
                    this.dis_sumins01 = true;
                    this.dis_sumins02 = true;
                    this.euad2.sumins01 = 0;
                    this.euad2.sumins02 = 0;
                }
            }
        },
        watch:{
            /**insureDataForm:{
                handler(val, oldVal){
                   if(this.insureDataForm != undefined){
                        this.$emit('updataInsureEx', this.insureDataForm)
                    }
                },
                deep:true
            }**/
        }
    }
</script>
<style lang="less" scoped>
.baseInfoPage{
    .common-box{
        padding-bottom: 15px;
    }
    .common-lab{
        line-height:normal!important;
        text-align: right;
        .labelName{
            text-align: right;
        }
    }
}
</style>